var feedwhat;
//$.mobile.changePage( "about/us.html", { transition: "slideup"} );
$( document ).bind( 'mobileinit', function(){
  $.mobile.loader.prototype.options.text = "loading";
  $.mobile.loader.prototype.options.textVisible = false;
  $.mobile.loader.prototype.options.theme = "a";
  $.mobile.loader.prototype.options.html = "";
  
 
});

$('div#home').live('pageshow',function(event){
        getFeed('home');
});

$('div#catview').live('pageshow',function(event){
        var caid = getParameterByName('cid');
        $(".content").html(" You are reading "+caid+" news feeds");
        getFeed(caid);
});


function getParameterByName(name) {
  var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
  return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
}

function getFeed(cat){
    $.mobile.loading('show',{text:'loading wait...',textVisible:true,theme:'a'});
    $.ajax({
      url: 'http://localhost/test2/feed/feed.php?what='+cat,
      success: function(feed) {
         $(".content").html(feed);
         $.mobile.loading( 'hide');
      }
   });

  
}